﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="verify-v1" content="o55KxA5E38GJd8RysBJgUphs+pmzc/epBT+2aONirdo=" />
    
    <title>
        {% block title %}
        iPSmth Home Page
        {% endblock %}
    </title>

    <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

    <link rel="stylesheet" href="/media/stylesheets/iphone.css" type="text/css" />
    
    <script src="/media/scripts/jquery-1.2.3.min.js" type="text/javascript"></script>
    
    <script type="application/x-javascript">

        addEventListener("load", function() { setTimeout(updateLayout, 0); }, false);

        var currentWidth = 0;

        function updateLayout() {
            if (window.innerWidth != currentWidth) {
                currentWidth = window.innerWidth;
                document.getElementById('width').innerHTML = "[width = " + currentWidth + "px]";
                var orient = currentWidth == 320 ? "profile" : "landscape";
                document.body.setAttribute("orient", orient);
                setTimeout( function() { window.scrollTo(0, 1); }, 100);
            }
        }

        setInterval(updateLayout, 400);

    </script>

    <script type="application/x-javascript">
        function hideURLbar() {
            window.scrollTo(0, 1);
        }

        if (navigator.userAgent.indexOf('iPhone') != -1) {
            addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
        }
    </script>
    
    <script type="application/x-javascript">
        function toggleAllPosts(board_id){
            $(".p_div").each(
                function(i){
                    //alert(i+', '+board_id);
                    //alert('html:'+$(this).html());
                    //alert(i+', '+board_id+', '+$(this).attr("id"));
                    togglePost(board_id, $(this).attr("id"));
                }
            );
        }
        
        function togglePost(board_id, post_id){
            post = $("#"+post_id);
            if(post.html()==''){
                post.html('<a href="/p/?bid='+board_id+'&pid='+post_id+'"><img src="/media/images/ajax-loader.gif"/></a>');
                getPostContent(board_id, post_id);
                post.css("display", "block");
                $("#span_"+post_id).css("color", "#336600");
            }else{
                if(post.css("display") == 'block'){
                    post.css("display", "none");
                }else{
                    post.css("display", "block");
                }
            }
        }
        
        function getPostContent(board_id, post_id){
            //setTimeout($.get("/p/?bid="+board_id+"&pid="+post_id, function(data){ $("#"+post_id).html(data); } ), 1000000);
            $.get("/p/?bid="+board_id+"&pid="+post_id, function(data){ $("#"+post_id).html(data); } );
        }
        
        $(document).ready(function() {
            {% block onloadscript %}
            {% endblock %}
        });
    </script>
</head>

<body>
    
	<div class="container">
        {% block contents %}
        {% endblock %}
	</div>
    
    <div align="center">
        <a href='/'><img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" /></a>
    </div>
    
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-4049556-4");
    pageTracker._trackPageview();
    </script>

</body>
</html>
